/**
 * 定义天数据模块
 */
(function(window, angular, undefined){
	var module = angular.module('water.apps.voc.reportHistory.reportDayDataManager', ['water.apps.voc.reportHistory.reportMinDataManager',
	                                                                                  'water.common.dateUtil','water.entity.monitorData']);
	
	module.controller('reportDayDataManagerController',function($rootScope,$scope,$controller,$dateUtil,$monitorDataService){

		var control = $controller("reportMinDataManagerController",{$scope:$scope});
		
		$scope.dataAPIName = "dayListGetter";
		$scope.dataAuditAPIName = "dayAuditListGetter";
		$scope.dataExportAPIName = "exportDayExcel";
		/**
		 * 开始时间
		 */
		$scope.startDate;
		/**
		 * 结束时间
		 */
		$scope.endDate;
		/**
		 * 获取查询参数,重写，跟基类不一样的地方在于，这里起始和结束时间直接取的是控件的值
		 * 而基类是通过选择小时，然后拼接
		 */
		$scope.getQueryObject = function(){
			var parmsStr = $scope.selectedModel.parmToChecksStr;
			var queryObject = {
					"MN":$scope.selectedModel.MN,
					"PARMS":parmsStr,
					"START":$scope.startDate + " 00:00:00",
					"END":$scope.endDate + " 23:59:59"
				};
			return queryObject;
		}
		
		/**
		 * 初始化
		 */
		function _init(){
			var endDate = new Date();
			var startDate = $dateUtil.addDay(endDate,-1)
			$scope.startDate = $dateUtil.formatDate(startDate,'yyyy-MM-dd');
			$scope.endDate = $dateUtil.formatDate(endDate,'yyyy-MM-dd');
		}
		_init();
		
	});
}(window, angular));	